import request from '@/hooks/request'

const Api = {
  wechatConfigPushRobots: '/platform/wechatRobot/wechatConfigPushRobots',
  getWechatConfig: '/platform/wechatRobot/getWechatConfig',
  getIdleFishConfig: '/platform/fish/getFishConfig',
  fishConfigPushRobots: '/platform/fish/fishConfigPushRobots',
  getAreaList: '/platform/area/getAreaList',
}

export const getAreaList = () => {
  return request({
    method: 'post',
    url: Api.getAreaList,
  })
}

export const wechatConfigPushRobots = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.wechatConfigPushRobots,
    data: parameter,
  })
}

export const getWechatConfig = (parameter: Record<any, any>) => {
  const formData = new FormData()
  formData.append('robotId', parameter.robotId)
  return request({
    method: 'post',
    url: Api.getWechatConfig,
    data: formData,
  })
}

export const getIdleFishConfig = (parameter: Record<any, any>) => {
  const formData = new FormData()
  formData.append('robotId', parameter.robotId)
  return request({
    method: 'post',
    url: Api.getIdleFishConfig,
    data: formData,
  })
}

export const fishConfigPushRobots = (parameter: Record<any, any>) => {
  return request({
    method: 'post',
    url: Api.fishConfigPushRobots,
    data: parameter,
  })
}
